<template>
  <div class="flex-height" :class="{'gray':grayShow}">
    <transition name="el-fade-in-linear">
      <router-view/>
    </transition>
  </div>
</template>

<style>

@import "./assets/scss/pages/style.scss";
  .gray{
    /*filter: grayscale(100%);*/
    /*-webkit-filter: grayscale(100%);*/
  }
.el-input.is-active .el-input__inner, .el-input__inner:focus{
  border-color: #DCDFE6 !important;
}
.el-breadcrumb__item:last-child .el-breadcrumb__inner{
  color: #107BFF !important;
}
</style>
<script>
import Cookies from 'js-cookie'
import { messages } from '@/i18n'
export default {
  props: ['name'],
  data: function () {
    return {
      show: [],
      grayShow: false
    }
  },
  watch: {
    '$i18n.locale': 'i18nHandle'
  },
  created () {
    this.i18nHandle(this.$i18n.locale)
  },
  mounted () {
  },
  methods: {
    i18nHandle (val, oldVal) {
      Cookies.set('language', val)
      document.querySelector('html').setAttribute('lang', val)
      document.title = messages[val].brand.lg
      // 非登录页面，切换语言刷新页面
      if (this.$route.name !== 'login' && oldVal) {
        window.location.reload()
      }
    }
  }
}
</script>
